package string;

public class StringDemo {
    public static void main(String[] args) {
        String s = new String("hello");
        String s1 = "hello";
        System.out.println(s.equals(s1));
        //==比较的是地址是否相同
        //String 比较相等，一般都是比较字符串的内容是否相同



        /*
        String s1 = "123abc";
        String s2 = "123"+"abc";
        System.out.println(s1==s2);
        String s3 = "123";
        String s4 = s3+"abc";
        System.out.println(s1==s4);

         */

        /*
        String s1 = "123abc";
        String s2 = "123abc";
        String s3 = "123abc";
        System.out.println(s1==s2);
        System.out.println(s2==s3);
        System.out.println(s1==s3);

         */
    }
}
